package com.lyy.Consumer;

import lombok.SneakyThrows;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author Liangyaoyun
 */
@Component
public class HeadersConsumerA {
    @SneakyThrows
    @RabbitListener(queuesToDeclare = @Queue("My_Headers_QueueA"))
    public void consume(Message message) {
        System.out.println("队列A收到消息: " + new String(message.getBody()));
    }
}
